<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Getting Started with ml5.js</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../common/tensorflow-0.9.0.js"></script>
  </head>

  <body>

    <script>
      var w = 0.0579
      var b = -13.07

      function predict(x){
        return x * w + b
      }

      //类比

      var weight = tf.tensor(0.0579)
      var bias = tf.tensor(-13.07)

      function predict_tf(x){
        return tf.tensor(x).mul(w).add(b)
      }

    </script>
  </body>
</html>